package com.zhhtech.zhh.ui.widget;

import android.os.Parcel;
import android.os.Parcelable;


/**
 * Created by zhoucl on 2018/11/14 0014.
 */
public class UnSpanText implements Parcelable {
    private int start;
    private int end;
    private String data;
    private Integer id;
    private String showText;
    private int colorId;

    public UnSpanText() {
    }

    public UnSpanText(int start, int end, Integer id, String showText, int colorId) {
        this.start = start;
        this.end = end;
        this.id = id;
        this.showText = showText;
        this.colorId = colorId;
    }

    public UnSpanText(int start, int end, String data, CharSequence showText) {
        this(start, end, data, showText.toString());
    }

    public UnSpanText(int start, int end, String data, String showText) {
        this.start = start;
        this.end = end;
        this.data = data;
        this.showText = showText;
    }

    public UnSpanText(int start, int end, Integer id, String showText) {
        this.start = start;
        this.end = end;
        this.id = id;
        this.showText = showText;
    }

    public UnSpanText(int start, int end, CharSequence showText) {
        this.start = start;
        this.end = end;
        this.showText = showText.toString();
    }


    public int getColorId() {
        return colorId;
    }

    public void setColorId(int colorId) {
        this.colorId = colorId;
    }

    public int getStart() {
        return start;
    }

    public void setStart(int start) {
        this.start = start;
    }

    public int getEnd() {
        return end;
    }

    public void setEnd(int end) {
        this.end = end;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getShowText() {
        return showText;
    }

    public void setShowText(String showText) {
        this.showText = showText;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.start);
        dest.writeInt(this.end);
        dest.writeString(this.data);
        dest.writeValue(this.id);
        dest.writeString(this.showText);
        dest.writeInt(this.colorId);
    }

    protected UnSpanText(Parcel in) {
        this.start = in.readInt();
        this.end = in.readInt();
        this.data = in.readString();
        this.id = (Integer) in.readValue(Integer.class.getClassLoader());
        this.showText = in.readString();
        this.colorId = in.readInt();
    }

    public static final Creator<UnSpanText> CREATOR = new Creator<UnSpanText>() {
        @Override
        public UnSpanText createFromParcel(Parcel source) {
            return new UnSpanText(source);
        }

        @Override
        public UnSpanText[] newArray(int size) {
            return new UnSpanText[size];
        }
    };
}
